import request from "../utils/request";

//添加购物车
export const addToCart = (skuId, skuNum) => {
  return request({
    method: "POST",
    url: `/cart/addToCart/${skuId}/${skuNum}`,
  });
};
//获取购物车数据
export const cartList = () => {
  return request({
    method: "GET",
    url: `/cart/cartList`,
  });
};

//修改选中状态
export const getIsChecked = (skuID, isChecked) => {
  return request({
    method: "GET",
    url: `/cart/checkCart/${skuID}/${isChecked}`,
  });
};

//删除购物车中的单个商品
export const deleteGoods = (skuId) => {
  return request({
    method:"DELETE",
    url: `/cart/deleteCart/${skuId}`,
  });
};

//
